//
//  RMMGoodsJiaoShaoTableViewCell.m
//  Romomo
//
//  Created by puman on 16/10/11.
//  Copyright © 2016年 mazegong. All rights reserved.
//

#import "RMMGoodsJiaoShaoTableViewCell.h"

@implementation RMMGoodsJiaoShaoTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        _ceeScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, kScreenWideth, 166)];
        _ceeScrollView.backgroundColor = kWhiteColor;
        _ceeScrollView.showsVerticalScrollIndicator = NO;
        _ceeScrollView.showsHorizontalScrollIndicator = NO;
        [self.contentView addSubview:_ceeScrollView];
        
    }
    return self;
}
- (void)setStepArray:(NSArray *)stepArray{
    NSMutableArray *step = [NSMutableArray arrayWithArray:stepArray];
    for (NSDictionary *dic in stepArray) {
        NSInteger index = [dic[@"DES_NUMBER"] integerValue];
        [step replaceObjectAtIndex:index - 1 withObject:dic];
    }
    for (int i = 0; i < step.count; i++) {
        NSDictionary *dic = step[i];
        UIView *view = [[UIView alloc] initWithFrame:CGRectMake(15 + 146 * i, 15, 136, 166)];
        view.layer.masksToBounds = YES;
        view.layer.cornerRadius = 5;
        view.backgroundColor = COLORFROMCODE(0xF3F2F3, 1);
        [_ceeScrollView addSubview:view];
        
        UIImageView *imageV = [[UIImageView alloc] initWithFrame:CGRectMake(8, 8, 120, 120)];
        [imageV sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@%@",kBaseImageUrl,[RMMFileManager retrunObjWith:dic[@"IMAGEURL"]]]] placeholderImage:[UIImage imageNamed:@"加载中@3x"]];
        [view addSubview:imageV];
        UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, imageV.bottom, view.width, kMaric)];
        titleLabel.textAlignment = NSTextAlignmentCenter;
        titleLabel.font = kFont(14);
        titleLabel.text = [NSString stringWithFormat:@"%@、%@",dic[@"DES_NUMBER"],dic[@"DESCRIBE"]];
        titleLabel.textColor = COLORFROMCODE(0x000000, 1);
        [view addSubview:titleLabel];
    }
    _ceeScrollView.contentSize = CGSizeMake(kMaric + 146 * stepArray.count, 166);

}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
